<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	  xmlns:cc="http://java.sun.com/jsf/composite"
	  xmlns:f="http://java.sun.com/jsf/core"
	  xmlns:h="http://java.sun.com/jsf/html"
	  xmlns:c="http://java.sun.com/jsp/jstl/core">
	
	<cc:interface>
		<cc:attribute name="value" required="true"/>
		<cc:attribute name="rowId" required="true"/>
		<cc:attribute name="rowName" required="true"/>
		
		<cc:attribute name="outcome" default=""/>
		<cc:attribute name="onclick" default=""/>
	</cc:interface>
	
	<cc:implementation>
		
		<c:choose>
			<c:when test="#{cc.attrs.onclick==''}">
				<c:set var="onclickScript" value=";"/>
			</c:when>
			<c:otherwise>
				<c:set var="onclickScript" value="#{cc.attrs.onclick}(#{cc.attrs.rowId},'#{cc.attrs.rowName}')"/>
			</c:otherwise>
		</c:choose>
		
		<h:link id="nameLink" 
				outcome="#{cc.attrs.outcome}" 
				class="cell-link" 
				onclick="#{onclickScript}"
				style="cursor: pointer">
			<f:param name="id" value="#{cc.attrs.rowId}"/>
			<div class="cell-div">
				#{cc.attrs.value}
			</div>
		</h:link>
	</cc:implementation>
</html>
